From c0d41e43157bca272cc2f18e59ff02730898a1f9 Mon Sep 17 00:00:00 2001 From: "kaf24@viper.(none)" Date: Sun, 6 Feb 2005 12:09:52 +0000 Subject: [PATCH] bitkeeper revision 1.1159.223.72 (42060910CAWXk13FiquPxR_uRrD_1A) Prevent stack overflow in PCI setup code. Signed-off-by: keir.fraser@cl.cam.ac.uk --- xen/arch/x86/pci-pc.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/pci-pc.c b/xen/arch/x86/pci-pc.c index cb5889628c..c3c097efdc 100644 --- a/xen/arch/x86/pci-pc.c +++ b/xen/arch/x86/pci-pc.c @@ -1,3 +1,4 @@ +/* -*- Mode:C; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- */ /* * Low-Level PCI Support for PC * @@ -445,8 +446,9 @@ static struct pci_ops pci_direct_conf2 = { static int __devinit pci_sanity_check(struct pci_ops *o) { u16 x; - struct pci_bus bus; /* Fake bus and device */ - struct pci_dev dev; + /* XEN: static is important to prevent stack overflow! */ + static struct pci_bus bus; /* Fake bus and device */ + static struct pci_dev dev; if (pci_probe & PCI_NO_CHECKS) return 1; @@ -1131,8 +1133,9 @@ static void __devinit pcibios_fixup_ghosts(struct pci_bus *b) static void __devinit pcibios_fixup_peer_bridges(void) { int n; - struct pci_bus bus; - struct pci_dev dev; + /* XEN: static is important to prevent stack overflow! */ + static struct pci_bus bus; + static struct pci_dev dev; u16 l; if (pcibios_last_bus <= 0 || pcibios_last_bus >= 0xff) -- 2.30.2